package me.notfirecodes.serverpatcher;

import me.notfirecodes.serverpatcher.cmds.CustomMaxHealthCMD;
import me.notfirecodes.serverpatcher.cmds.GlowingFixCMD;
import me.notfirecodes.serverpatcher.cmds.MaxHealthCMD;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

public final class Serverpatcher extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        // Plugin startup logic
        getCommand("cmaxhealth").setExecutor(new CustomMaxHealthCMD());
        getCommand("maxhealth").setExecutor(new MaxHealthCMD());
        getCommand("stopglow").setExecutor(new GlowingFixCMD());
        getServer().getPluginManager().registerEvents(this, this);
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
    @EventHandler
    public void healthFixer(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        player.setMaxHealth(20);
        player.setHealth(20);
    }
}
